package com.xc.hotelmgr.datapusherali;

import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONObject;
import org.junit.jupiter.api.Test;

public class test {
/*

{
    "status":1,
    "hotelCode":"11001",
    "roomCode":"rm01",
    "rpCode":"rp01",
    "breakfastNum":2,
    "cancelPolicy":"{'cancelPolicyType':1}",
    "hotelName":"豪华大床双早",
    "appKey":"24670810",
    "sessionKey":"61005048d9db17ae418bc88c5b68da013c8c2c1d1ba85af2137697781",
    "secret":"da693e866400c065ca18427666b81f00"
}

 */
    public static void main(String[] args) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("cancelPolicyType", 1);
        JSONObject data = new JSONObject();
        data.put("status",1);
        data.put("hotelCode","11001");
        data.put("roomCode","rm01");
        data.put("rpCode","rp01");
        data.put("breakfastNum", 2);
        data.put("paymentType", 1);
        data.put("cancelPolicy", jsonObject.toJSONString());
        data.put("rpName", "豪华大床双早");
        data.put("appKey", "24670810");
        data.put("sessionKey", "61005048d9db17ae418bc88c5b68da013c8c2c1d1ba85af2137697781");
        data.put("secret", "da693e866400c065ca18427666b81f00");
        String result = HttpRequest.post("http://localhost:8000/rateplan/change_rateplan").body(String.valueOf(data)).execute().body();
        System.out.println(result);
    }
}
